import 'package:plugin_platform_interface/plugin_platform_interface.dart';

import 'jdunion_plugin_method_channel.dart';

abstract class JdunionPluginPlatform extends PlatformInterface {
  /// Constructs a JdunionPluginPlatform.
  JdunionPluginPlatform() : super(token: _token);

  static final Object _token = Object();

  static JdunionPluginPlatform _instance = MethodChannelJdunionPlugin();

  /// The default instance of [JdunionPluginPlatform] to use.
  ///
  /// Defaults to [MethodChannelJdunionPlugin].
  static JdunionPluginPlatform get instance => _instance;
  
  /// Platform-specific implementations should set this with their own
  /// platform-specific class that extends [JdunionPluginPlatform] when
  /// they register themselves.
  static set instance(JdunionPluginPlatform instance) {
    PlatformInterface.verifyToken(instance, _token);
    _instance = instance;
  }

  Future<String?> getPlatformVersion() {
    throw UnimplementedError('platformVersion() has not been implemented.');
  }

  Future<void> initJdUnion(String version) {
    throw UnimplementedError('initJdUnion() has not been implemented.');
  }

  Future<dynamic> openJDAppByUrl(String url) {
    throw UnimplementedError('openJDAppByUrl() has not been implemented.');
  }

  Future<dynamic> openJXAppByUrl(String url) {
    throw UnimplementedError('openJXAppByUrl() has not been implemented.');
  }
}
